package org.openwork.portlet.skillmanagement.service.persistence;

import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil;
import com.liferay.portal.kernel.dao.orm.DynamicQuery;
import com.liferay.portal.kernel.exception.SystemException;

import org.openwork.portlet.skillmanagement.model.Skill;

import java.util.List;


/**
 * <a href="SkillUtil.java.html"><b><i>View Source</i></b></a>
 *
 * <p>
 * ServiceBuilder generated this class. Modifications in this class will be
 * overwritten the next time is generated.
 * </p>
 *
 * @author    Samuel Garcia Martinez
 * @see       SkillPersistence
 * @see       SkillPersistenceImpl
 * @generated
 */
public class SkillUtil {
    private static SkillPersistence _persistence;

    /**
     * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
     */
    public static void clearCache() {
        getPersistence().clearCache();
    }

    /**
     * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(Skill)
     */
    public static void clearCache(Skill skill) {
        getPersistence().clearCache(skill);
    }

    /**
     * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
     */
    public long countWithDynamicQuery(DynamicQuery dynamicQuery)
        throws SystemException {
        return getPersistence().countWithDynamicQuery(dynamicQuery);
    }

    /**
     * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
     */
    public static List<Skill> findWithDynamicQuery(DynamicQuery dynamicQuery)
        throws SystemException {
        return getPersistence().findWithDynamicQuery(dynamicQuery);
    }

    /**
     * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
     */
    public static List<Skill> findWithDynamicQuery(DynamicQuery dynamicQuery,
        int start, int end) throws SystemException {
        return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
    }

    /**
     * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
     */
    public static Skill remove(Skill skill) throws SystemException {
        return getPersistence().remove(skill);
    }

    /**
     * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
     */
    public static Skill update(Skill skill, boolean merge)
        throws SystemException {
        return getPersistence().update(skill, merge);
    }

    public static void cacheResult(
        org.openwork.portlet.skillmanagement.model.Skill skill) {
        getPersistence().cacheResult(skill);
    }

    public static void cacheResult(
        java.util.List<org.openwork.portlet.skillmanagement.model.Skill> skills) {
        getPersistence().cacheResult(skills);
    }

    public static org.openwork.portlet.skillmanagement.model.Skill create(
        long id) {
        return getPersistence().create(id);
    }

    public static org.openwork.portlet.skillmanagement.model.Skill remove(
        long id)
        throws com.liferay.portal.kernel.exception.SystemException,
            org.openwork.portlet.skillmanagement.NoSuchSkillException {
        return getPersistence().remove(id);
    }

    public static org.openwork.portlet.skillmanagement.model.Skill updateImpl(
        org.openwork.portlet.skillmanagement.model.Skill skill, boolean merge)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getPersistence().updateImpl(skill, merge);
    }

    public static org.openwork.portlet.skillmanagement.model.Skill findByPrimaryKey(
        long id)
        throws com.liferay.portal.kernel.exception.SystemException,
            org.openwork.portlet.skillmanagement.NoSuchSkillException {
        return getPersistence().findByPrimaryKey(id);
    }

    public static org.openwork.portlet.skillmanagement.model.Skill fetchByPrimaryKey(
        long id) throws com.liferay.portal.kernel.exception.SystemException {
        return getPersistence().fetchByPrimaryKey(id);
    }

    public static java.util.List<org.openwork.portlet.skillmanagement.model.Skill> findByCategoryId(
        long categoryId)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getPersistence().findByCategoryId(categoryId);
    }

    public static java.util.List<org.openwork.portlet.skillmanagement.model.Skill> findByCategoryId(
        long categoryId, int start, int end)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getPersistence().findByCategoryId(categoryId, start, end);
    }

    public static java.util.List<org.openwork.portlet.skillmanagement.model.Skill> findByCategoryId(
        long categoryId, int start, int end,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getPersistence()
                   .findByCategoryId(categoryId, start, end, orderByComparator);
    }

    public static org.openwork.portlet.skillmanagement.model.Skill findByCategoryId_First(
        long categoryId,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws com.liferay.portal.kernel.exception.SystemException,
            org.openwork.portlet.skillmanagement.NoSuchSkillException {
        return getPersistence()
                   .findByCategoryId_First(categoryId, orderByComparator);
    }

    public static org.openwork.portlet.skillmanagement.model.Skill findByCategoryId_Last(
        long categoryId,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws com.liferay.portal.kernel.exception.SystemException,
            org.openwork.portlet.skillmanagement.NoSuchSkillException {
        return getPersistence()
                   .findByCategoryId_Last(categoryId, orderByComparator);
    }

    public static org.openwork.portlet.skillmanagement.model.Skill[] findByCategoryId_PrevAndNext(
        long id, long categoryId,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws com.liferay.portal.kernel.exception.SystemException,
            org.openwork.portlet.skillmanagement.NoSuchSkillException {
        return getPersistence()
                   .findByCategoryId_PrevAndNext(id, categoryId,
            orderByComparator);
    }

    public static java.util.List<org.openwork.portlet.skillmanagement.model.Skill> findAll()
        throws com.liferay.portal.kernel.exception.SystemException {
        return getPersistence().findAll();
    }

    public static java.util.List<org.openwork.portlet.skillmanagement.model.Skill> findAll(
        int start, int end)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getPersistence().findAll(start, end);
    }

    public static java.util.List<org.openwork.portlet.skillmanagement.model.Skill> findAll(
        int start, int end,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getPersistence().findAll(start, end, orderByComparator);
    }

    public static void removeByCategoryId(long categoryId)
        throws com.liferay.portal.kernel.exception.SystemException {
        getPersistence().removeByCategoryId(categoryId);
    }

    public static void removeAll()
        throws com.liferay.portal.kernel.exception.SystemException {
        getPersistence().removeAll();
    }

    public static int countByCategoryId(long categoryId)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getPersistence().countByCategoryId(categoryId);
    }

    public static int countAll()
        throws com.liferay.portal.kernel.exception.SystemException {
        return getPersistence().countAll();
    }

    public static SkillPersistence getPersistence() {
        if (_persistence == null) {
            _persistence = (SkillPersistence) PortletBeanLocatorUtil.locate(org.openwork.portlet.skillmanagement.service.ClpSerializer.SERVLET_CONTEXT_NAME,
                    SkillPersistence.class.getName());
        }

        return _persistence;
    }

    public void setPersistence(SkillPersistence persistence) {
        _persistence = persistence;
    }
}
